package com.anycc.cloud.auth.service.feign;

import com.anycc.cloud.auth.service.feign.fallback.AccountServiceFallbackImpl;
import com.anycc.cloud.core.dto.AccountDto;
import com.anycc.cloud.core.entity.Account;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * account service by feign client
 */
@FeignClient(value = "anycc-core", fallback = AccountServiceFallbackImpl.class)
public interface AccountService {
    /**
     * find account by username
     *
     * @param username username
     * @return account
     */
    @GetMapping("/account/findByUsername")
    AccountDto findByUsername(@RequestParam("username") String username);
}
